package com.qianniu.napi.admin.service.akka;

import akka.actor.ActorSystem;
import akka.actor.Props;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AkkaServer {

    private final static Logger logger = LoggerFactory.getLogger(AkkaServer.class);
    public static ActorSystem system = ActorSystem.create("qianniuhudong");

    public static final int actorCount = 2;

    static {
        try {

            for (int i = 0; i < actorCount; i++) {
                system.actorOf(Props.create(UserActor.class), "checker" + i);

            }
            logger.info("===========AkkaServer init ok");
        } catch (Exception e) {
            logger.error("===========Props.create(UserActor.class)", e);
        }
    }
}
